package com.example.product.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.product.entity.Account;
import com.example.product.entity.Admin;

/**
* @author ASUS
* @description 针对表【admin(管理员信息)】的数据库操作Mapper
* @createDate 2024-10-10 22:44:18
* @Entity com.example.product.entity.Admin
*/
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 操作admin相关数据接口
 */
public interface AdminMapper extends BaseMapper<Admin> {

    /**
     * 新增
     */
    int insert(Admin admin);

    /**
     * 删除
     */
    @Delete("delete from admin where id = #{id}")
    int deleteById(Integer id);

    /**
     * 修改
     */
    int updateById(Admin admin);

    /**
     * 根据ID查询
     */
    @Select("select * from admin where id = #{id}")
    Admin selectById(Integer id);

    /**
     * 查询所有
     */
    List<Admin> selectAll(Admin admin);

    @Select("select * from admin where username = #{username}")
    Admin selectByUsername(String username);

    Account selectOne(QueryWrapper<Account> queryWrapper);

}




